﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace Xms.Abp.Storage;

public interface IXmsStorageBulkOperationProvider : IEfCoreBulkOperationProvider
{
    Task DeleteManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, Expression<Func<TEntity, bool>> predicate, bool autoSave, CancellationToken cancellationToken)
        where TDbContext : IEfCoreDbContext
        where TEntity : class, IEntity;
    Task UpdateManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TEntity>> updateFactory, bool autoSave, CancellationToken cancellationToken)
        where TDbContext : IEfCoreDbContext
        where TEntity : class, IEntity;
    Task UpdateManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, Expression<Func<TEntity, bool>> predicate, Dictionary<string, object> values, bool autoSave, CancellationToken cancellationToken)
        where TDbContext : IEfCoreDbContext
        where TEntity : class, IEntity;
}
